<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <ul>
        <li>lililili</li>
        <li>lililili</li>
        <li>lililili</li>
        <li>lililili</li>
        <li>lililili</li>
        <li>lililili</li>
        <li>lililili</li>
        <li>lililili</li>
        <p>我是p标签</p>
    </ul>
    <script>
        const ul = document.querySelector('ul')
        ul.addEventListener('click', function (e) {
            //e.target 我点击谁 他就是谁
            // e.target.tagName 我点击谁具体的名字
            console.log(e.target.tagName);
            if (e.target.tagName === 'LI') {
                e.target.style.color = 'pink'
            }
        })
    </script>
</body>

</html>